﻿using System;
using System.Collections.Generic;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using Crimson;
using Crimson.Module;

public partial class _Default : Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            NewsList1.DataBind("金台寺");
            NewsList2.DataBind("白衣古寺");
            NewsList3.DataBind("隐秀寺");
            Kaishi_bind();
        }
    }

    private void Kaishi_bind()
    {
        IList<Info> result = InfoManager.DaoFactory.InfoDao.Find("法师开示", 0, 1, false, InfoState.Published);
        if (result.Count != 0)
        {
            InfoManager.FillContent(result[0]);
            LabelKaishi.Text = result[0].Title;
            var content = new HtmlGenericControl {InnerHtml = result[0].Content};

            PlaceHolderKaishiContent.Controls.Add(content);
        }
    }
}